package com.example.demo.mapper;

import com.example.demo.model.ArticleInfo;
import com.example.demo.model.UserInfo;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;

import java.util.List;

@Mapper
public interface ArticleInfoMapper {
    @Select(" SELECT  " +
            " ta.id,ta.title,ta.content,ta.uid,tb.username,tb.age," +
            " tb.gender  FROM articleinfo ta LEFT " +
            " JOIN user_info tb ON ta.uid = tb.id WHERE ta.id = #{id}")
    List<ArticleInfo> selectAll(UserInfo userInfo);
}
